package com.lanxin.xxform.services;

import java.util.List;

import com.lanxin.xxform.beans.Paper;

public interface PaperService {

    int STATUS_HIDE     = 1; //状态：隐藏
    int STATUS_OPEN     = 2; //状态：公开
    
    int TYPE_RADIO      = 1; //类型：单选
    int TYPE_CHECKBOX   = 2; //类型：多选
    int TYPE_INPUT      = 3; //类型：填空

    /**
     * 保存问卷
     * @param paper
     * @return
     */
    int save(Paper paper);

    /**
     * 获取问卷详情
     * @param id
     * @return
     */
    Paper get(long id);

    /**
     * 统计问卷数量
     * @param keyword
     * @param status
     * @param uid
     * @return
     */
    int getCount(String keyword, int status, long uid);

    /**
     * 搜索问卷列表
     * @param offset
     * @param limit
     * @param keyword
     * @param status
     * @param uid
     * @return
     */
    List<Paper> getList(int offset, int limit, String keyword, int status, long uid);

    /**
     * 删除问卷
     * @param id
     * @param uid
     * @return
     */
    int delete(long id, long uid);

}
